package game;

import java.io.IOException;

import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;
import javax.microedition.lcdui.game.Sprite;

/**
 * level exit
 * @author Simon
 *
 */
public class Exit implements ArenaObject {

	int tile_x, tile_y;
	Sprite gfx = null;
	boolean visible;
	boolean dead;
	
	public Exit(int tile_x, int tile_y) {
		visible = false;
		this.tile_x = tile_x;
		this.tile_y = tile_y;
		System.err.println("exit at " + tile_x + " " + tile_y);
		try {
			gfx = new Sprite(Image.createImage("/gfx/boni.png"), 20, 20);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		gfx.setFrame(4);
		Arena.Position(gfx, tile_x, tile_y);
	}
	
	public void advance() {
	}

	public void draw(Graphics g) {
		if (visible) gfx.paint(g);
	}

	public boolean isDead() {
		return false;
	}

	public void setVisible(boolean visible) {
		this.visible = visible;
	}
}
